import yaml
import os

def load_yaml(file_path)->dict:
    """
    加载yaml文件
    :param file_path:
    :return:
    """
    with open(file_path, 'r', encoding='utf-8') as f:
        data = yaml.load(f, Loader=yaml.FullLoader)
    return data

def walk_apk_dir(dir_path) -> list:
    """
    遍历目录
    :param dir_path:
    :return:
    """
    apk_list = []
    # os.walk 返回的是一个三元组，分别是路径，目录列表，文件列表

    for item in os.walk(dir_path):
       apk_list.append([os.path.join(item[0], i)  for i in item[2]])

    return apk_list

def walk_source_dir(dir_path) -> list:

    source_list = list(os.walk(dir_path))[0][2]

    return source_list


